#include "rangeedititem.h"
#include "ui_rangeedititem.h"

RangeEditItem::RangeEditItem(const QString& name,QWidget *parent) :
    QWidget(parent),
    ui(new Ui::RangeEditItem)
{
    ui->setupUi(this);
    ui->lab_name->setText(name);
}

RangeEditItem::~RangeEditItem()
{
    delete ui;
}

void RangeEditItem::setHi(float h)
{
    ui->le_hi->setText(QString::number(h));
}

void RangeEditItem::setLo(float l)
{
    ui->le_lo->setText(QString::number(l));
}

float RangeEditItem::getHi()
{
    return ui->le_hi->text().toFloat();
}

float RangeEditItem::getLo()
{
    return ui->le_lo->text().toFloat();
}

Range RangeEditItem::getRange()
{
    Range r;
    r.hi = ui->le_hi->text().toFloat();
    r.lo = ui->le_lo->text().toFloat();
    return r;
}
